<template>
  <el-row :gutter="40" class="link-group">
    <el-col :xs="24" :sm="24" :lg="12" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('enter')">
        <div class="card-panel-icon-wrapper icon-people">
          <svg-icon icon-class="peoples" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">
            实验数据录入
          </div>
        </div>
      </div>
    </el-col>
    <el-col :xs="24" :sm="24" :lg="12" class="card-panel-col">
      <div class="card-panel" >
        <div class="card-panel-icon-wrapper icon-message">
          <svg-icon icon-class="message" class-name="card-panel-icon" />
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text" >
            实验结果查询
          </div>
        </div>

        <div class="form-group">
          <el-select v-model="test"
                     placeholder="请选择"
                     clearable
                     filterable>
            <el-option
              v-for="material in options"
              :key="material.value"
              :label="material.label"
              :value="material.value"
            ></el-option>

          </el-select>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSetLineChartData1('inquire',test)" style="margin-left: 20px;">搜索</el-button>
        </div>
      </div>
    </el-col>
  </el-row>

</template>

<script>
import {listExperimentRequest} from "@/api/ruoyiyinzheng/experimentRequest";

import CountTo from 'vue-count-to'

export default {
  data() {
    return {
      test:undefined,
      queryParams: {
        // 全部实验数据表格数据
        experimentDatasViewList: [],
        // pageNum: 1,
        // pageSize: 10,
        experimentNumber: undefined,
        colorSchemeId: undefined,
        clorlNumber: undefined,
        artId: undefined,
        materialId: undefined,
        weight: undefined,
        unitId: undefined,
        formulaId: undefined,
        co2: undefined,
        temperature: undefined,
        pressure: undefined,
        timeConsuming: undefined,
        rations:undefined,
      },
      input: '',
      options: [],

    }
  },
  components: {
    CountTo
  },
  activated() {
    this.getList();
  },
  mounted() {
    this.$nextTick(() => {
      this.getList();
    })
  },
  methods: {

    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
    },
    handleSetLineChartData1(type,int) {
      this.$emit('handleSetLineChartData1', type,int)
    },
    // handleClick() {
    //
    //   listExperimentRequest(this.queryParams).then(response => {
    //     console.log(response);
    //     let d=  response.rows;
    //     this.options=[];
    //     for (let i = 0; i < response.total; i++) {
    //       this.options.push({
    //         value: i,
    //         label: d[i].experimentNumber
    //       });
    //     }
    //   });
    // },
    getList()
    {
      listExperimentRequest().then(response => {
        this.options =  response.rows.map(item => ({
          value: item.experimentNumber,
          label: '实验编号:'+item.experimentNumber+'配方:'+item.receiptName,
        }));

      });
    },
  }
}
</script>

<style lang="scss" scoped>
.link-group {
  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #051b38;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgb(255, 255, 255);
        font-size: 16px;
        margin-bottom: 12px;
      }



      .card-panel-num {
        font-size: 20px;
      }
    }

    .form-group {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      float: left;
      margin: 20px 20px 20px 20px;
      padding: 16px;
      border-radius: 6px;
    }

  }
}

@media (max-width:550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
